/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mb.mbpart.object;

import net.sf.json.JSONObject;
import org.json.simple.JSONValue;

/**
 *
 * @author thanh.nguyenchi
 */
public class CategoryObject {
    static String STR_C_CATEGORY_ID = "id";
    static String STR_C_NAME = "name";
    static String STR_C_CATEIMAGE = "thumbnail";  
    static String STR_C_PARENT_ID = "parentId";
    static String STR_C_SCREEN = "screen";
    static String STR_C_SCREEN_DETAIL = "screendetail";
    
    //public field
    public long C_CATEGORY_ID;
    public String C_NAME;
    public String C_CATE_IMAGE;
    public long C_PARENT_ID;
    public String C_SCREEN;
    public String C_SCREEN_DETAIL;
    
    public CategoryObject(){}
    
    public String toJson(){
        JSONObject objRecv = new JSONObject();
        objRecv.put(STR_C_CATEGORY_ID, new Long(this.C_CATEGORY_ID));
        objRecv.put(STR_C_PARENT_ID, new Long(this.C_PARENT_ID));
        objRecv.put(STR_C_NAME, this.C_NAME);
        objRecv.put(STR_C_SCREEN, this.C_SCREEN);
        objRecv.put(STR_C_SCREEN_DETAIL, this.C_SCREEN_DETAIL);
        objRecv.put(STR_C_CATEIMAGE, this.C_CATE_IMAGE);        
        return JSONValue.toJSONString(objRecv);
    }
    
    public String toShortJson(){
        JSONObject objRecv = new JSONObject();
        objRecv.put(STR_C_CATEGORY_ID, new Long(this.C_CATEGORY_ID));
        objRecv.put(STR_C_NAME, this.C_NAME);
        return JSONValue.toJSONString(objRecv);
    }
   
}
